﻿using System;
using System.Data;
using System.Configuration;
using System.IO;
using System.Xml;
using System.ComponentModel;
using System.Web;

namespace AMG.Config
{
    public class UiConfig
    {
        public static string WebDAL = ConfigurationManager.AppSettings["WebDAL"];
        public static string DataRe = ConfigurationManager.AppSettings["dataRe"];
        public static string mssql = ConfigurationManager.AppSettings["mssql"];
        public static string PageTitle = ConfigurationManager.AppSettings["webName"];
        public static string SiteName = ConfigurationManager.AppSettings["SiteName"];
        public static string Domain = ConfigurationManager.AppSettings["Domain"];
        public static string RootUrl = ConfigurationManager.AppSettings["Url"];
        public static string RegSwitch = ConfigurationManager.AppSettings["RegSwitch"];
        public static string SkinStyle = ConfigurationManager.AppSettings["SkinStyle"];
        public static string defaultfriend = ConfigurationManager.AppSettings["defaultfriend"];
        public static string intel = ConfigurationManager.AppSettings["intel"];
        public static string ichange = ConfigurationManager.AppSettings["ichange"];
        public static string gName = ConfigurationManager.AppSettings["gName"];
        public static string MiniType = ConfigurationManager.AppSettings["MiniType"];
        public static int PhotoNum = int.Parse(ConfigurationManager.AppSettings["PhotoNum"]);
        public static string CookieDomain = ConfigurationManager.AppSettings["CookieDomain"];
        public static string HrSwitch = ConfigurationManager.AppSettings["HrSwitch"];
        public static string HrPassPortURL = ConfigurationManager.AppSettings["HrPassPortURL"];
        public static string NeedConfirm = ConfigurationManager.AppSettings["NeedConfirm"];

        /// <summary>
        /// 取得参数配置每页显示记录多少条
        /// </summary>
        /// <returns>返回数值型</returns>
        public static int GetPageSize()
        {
            int n = Convert.ToInt32(BaseConfig.GetConfigValue("PageSize"));
            if (n < 1)
                throw new Exception("每页记录条数不能小于1!");
            return n;
        }
    }
}
